/*
 * 系统项目名称：大屏系统
 * 文件名：ExportPortDataVo.java
 * 描述：
 * 版权：Copyright 2015-2020 义乌市跨境电商供应链管理有限公司-版权所有
 * 修改人：yangjx
 * 修改时间：2016-2-26 上午10:30:47
 * 版本号：V1.1
 */
package com.ywt.cda.service.vo;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;

/**
 * （一句话功能简述） <br>
 * （功能详细描述）
 * 
 * @author yangjx
 * @version V1.0
 * @see [相关类/方法]
 * @since 2016-2-26 上午10:30:47
 */
public class ExportPortDataVo implements Comparable<Object> {
	private String portCity;
	private String dayData;
	private String totalData;

	public String getDayData() {
		return dayData;
	}

	public void setDayData(String dayData) {
		this.dayData = dayData;
	}

	public String getTotalData() {
		return totalData;
	}

	public void setTotalData(String totalData) {
		this.totalData = totalData;
	}

	public String getPortCity() {
		return portCity;
	}

	public void setPortCity(String portCity) {
		this.portCity = portCity;
	}

	@Override
	public int compareTo(Object arg0) {
		long totalDataThis = Long.parseLong(this.totalData);

		if (arg0 instanceof ExportPortDataVo) {
			ExportPortDataVo s = (ExportPortDataVo) arg0;
			long anotherTotalData = Long.parseLong(s.getTotalData());
			if (totalDataThis >= anotherTotalData) {
				return -1;
			}
			else {
				return 1;
			}
		}
		return -1;

	}
public String toString(){
	return ReflectionToStringBuilder.reflectionToString(this);
}
	public static void main(String[] args) {
		List<ExportPortDataVo> vos = new ArrayList<ExportPortDataVo>();
		ExportPortDataVo v0=new ExportPortDataVo();
		v0.setTotalData("1");
		ExportPortDataVo v1=new ExportPortDataVo();
		v1.setTotalData("2");
		ExportPortDataVo v2=new ExportPortDataVo();
		v2.setTotalData("10");
		ExportPortDataVo v3=new ExportPortDataVo();
		v3.setTotalData("8");
		ExportPortDataVo v4=new ExportPortDataVo();
		v4.setTotalData("16");
		vos.add(v0);
		vos.add(v1);
		vos.add(v2);
		vos.add(v3);
		vos.add(v4);
		Collections.sort(vos);
		System.out.println(vos);
	}
}
